package com.yayan.beautyclub.dao;

import java.util.List;

import com.yayan.beautyclub.bean.User;

/**
 * 
 * @author 刘超
 *
 */
public interface IUserDao {
	
	/**
	 * 根据uId获取用户信息
	 * @param uId
	 * @return
	 * @throws Exception
	 */
	User findUserById(long uId) throws Exception;
	
	/**
	 * 根据openId查找用户
	 * @param openId
	 * @return
	 * @throws Exception
	 */
	User findUserByopenId(String openId) throws Exception;
	
	/**
	 * 插入用户openId并返回uId
	 * @param openId 微信唯一标识
	 * @return 用户uId
	 * @throws Exception
	 */
	long save(String openId) throws Exception;
	
	/**
	 * 根据uId更新用户信息(获取的微信信息)
	 * @param uId
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean update(long uId, User user) throws Exception;
	
	/**
	 * 更新用户预约时的电话与姓名
	 * @param uId
	 * @param user
	 * @return
	 * @throws Exception
	 */
	boolean setPhoneAndName(long uId, User user) throws Exception;
	
	/**
	 * 根据条件分页查询用户信息
	 * @param page 页码
	 * @param size 每页显示的数量
	 * @return
	 * @throws Exception
	 */
	List<User> findUserByCondition(int page, int size) throws Exception;
}
